package pers.jc.engine;

import pers.jc.netty.WebSocketServer;
import pers.jc.network.Dispatcher;

public class JCEngine {
	public static Class<? extends JCEntity> entityClass;

	public static void addComponent(Class<?> componentClass) {
		try {
			Dispatcher.addComponent(componentClass);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static void boot(int port, String path, Class<? extends JCEntity> entityClass) {
		try {
			JCEngine.entityClass = entityClass;
			WebSocketServer.run(port, path);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
